package com.stellar.auth.enums;


import lombok.Getter;

/**
 * @Author: Jqchan_
 */
@Getter
public enum PermissionTypeEnum {
    // 0 目录 1 菜单 2 按钮
    DIRECTORY(0, "目录"),

    MENU(1, "菜单"),

    BUTTON(2, "按钮");

    private Integer code;

    private String message;

    PermissionTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static PermissionTypeEnum getByCode(Integer type) {
        for (PermissionTypeEnum value : PermissionTypeEnum.values()) {
            if (value.code.equals(type)) {
                return value;
            }
        }
        return null;
    }
}
